package org.eleorc.ioc.javabased.basic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {

    private String name;

    public AppConfig() {
        System.out.println("AppConfig()");
    }

    @Autowired
    public AppConfig(String name) {
        System.out.println("AppConfig(String name):"+name);
        this.name = name;
    }

    @Bean
    public MyServiceImpl myService() {
        return new MyServiceImpl();
    }
}
